# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

# Credits AUR
# Maintainer: Aseem Athale <athaleaseem@gmail.com>

pkgname=python-tf-keras
_pkgname=${pkgname#python-}
pkgver=2.20.1
pkgrel=1
pkgdesc='TensorFlow-specific implementation of the Keras API.'
arch=('any')
url='https://github.com/keras-team/tf-keras'
license=('Apache-2.0')
depends=('absl-py' 'python' 'python-h5py' 'python-optree' 'python-rich'
         'python-ml-dtypes' 'python-packaging' 'python-numpy' 'python-pandas'
         'python-pillow' 'python-pydot' 'python-scipy' 'python-tensorflow'
         'python-yaml' 'tensorboard')
makedepends=('python-build' 'python-installer' 'python-wheel')
optdepends=('python-pytorch')
source=("https://files.pythonhosted.org/packages/py3/${_pkgname::1}/$_pkgname/${_pkgname//-/_}-$pkgver-py3-none-any.whl"
        "${_pkgname}-${pkgver}-LICENSE::https://raw.githubusercontent.com/keras-team/$_pkgname/v$pkgver/LICENSE")
sha512sums=('cc69e43f7fae9ab70cfbb9c5fb17c78f2fa603fbc91bf47a6f8ed71d174bdf46459f7e1eed093c92c22a24f137fe95e9ab86bced10a01f6658c66890dcd39ed2'
            '31cc38066678c030e8f6378dcae59add64566a977f92983c3a4c929c9b76424291915ea4283e1367ece50b9537f8d51970aa8fd5ce063037aa3a7c45f0677d25')

package() {
  # Using *.whl because the upstream source building needs old bazel version
  # that is not more available on Arch
  python -m installer --destdir="$pkgdir" *.whl
  install -Dm 644 "$_pkgname-$pkgver-LICENSE" \
    "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

